#include "stdafx.h"
#include "TestCirque.h"
#include "UECirque.h"
#include "UEEntityOperation.h"


CPPUNIT_TEST_SUITE_REGISTRATION( TestCirque );


TestCirque::TestCirque()
{
}


TestCirque::~TestCirque()
{
}

void TestCirque::testCreate()
{
	double dOutR;
	double dInR;
	AcGePoint3d CenterPoint;
	AcGeVector3d Vector;
	
	dOutR = 300;
	dInR  = 1;
	CenterPoint = AcGePoint3d::kOrigin;
	Vector      = AcGeVector3d::kZAxis;

	CUECirque Cirque( dOutR, dInR );
//	Cirque.Set( dOutR, dInR );
	
	AcDb3dSolid* pSolid = Cirque.Create();

	Acad::ErrorStatus es = CUEEntityOperation::AddEntityToDwg( pSolid );

	if ( es != Acad::eOk )
	{
		delete pSolid;
	}

	pSolid->close();
}

void TestCirque::testErrorCreate()
{
	double dOutR;
	double dInR;
	AcGePoint3d CenterPoint;
	AcGeVector3d Vector;
	
	dOutR = 300;
	dInR  = 200;
	CenterPoint = AcGePoint3d::kOrigin;
	Vector.set(0,0,0);     // = AcGeVector3d::kZAxis;

	CUECirque Cirque( dOutR, dInR, CenterPoint, Vector );
	
	AcDb3dSolid* pSolid = NULL;
	try
	{
		pSolid = Cirque.Create();
	}
	catch ( CString& strError )
	{
		CPPUNIT_NS::Asserter::fail( (LPCTSTR)strError );
	}

	Acad::ErrorStatus es = CUEEntityOperation::AddEntityToDwg( pSolid );

	if ( es != Acad::eOk )
	{
		delete pSolid;
	}

	pSolid->close();
}
